{% extends 'base-user.html' %}
{% load static %}

{% block user_content %}
<div class="info_con clearfix">
	<h3 class="common_title2">基本信息</h3>
	<ul class="user_info_list">
		<li><span>用户名：</span>{{ user.username }}</li>
		<li><span>加入日期：</span>{{ user.create_time | date:"Y-m-d" }}</li>
		<li><span>邮箱地址：</span>{{ user.email }}</li>
	</ul>
</div>
<h3 class="common_title2">优惠券</h3>
    <div class="user_info_list" >

    {% if quan == null %}
        <span style="display:block;">还没有优惠券</span>
    {% else %}
        <li style="margin:auto">{{ quan }}</li>
    {% endif %}
</div>
<h3 class="common_title2">最近浏览</h3>
<div class="has_view_list">
	<ul class="goods_type_list clearfix">
		{% for good in history_data %}
		<li>
			<a href='/goods/detail/{{ good.id }}/'><img src="{{ good.image.url }}"></a>
			<h4><a href="#">{{ good.name }}</a></h4>
			<div class="operate">
				<span class="prize">￥{{ good.price }}</span>
				<span class="unit">{{ good.price }}/{{ good.unite }}</span>
				<a href="javascript:" class="add_cart" title="加入购物车" id="add_cart"></a>
			</div>
		</li>
		{% empty %} <span>无历史浏览记录</span>
		{% endfor %}
	</ul>
</div>
    <script type="text/javascript" src="{% static 'js/jquery-1.12.4.min.js' %}"></script>
	<script type="text/javascript" src="{% static 'js/detail.js' %}"></script>
{% endblock user_content %}